<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>请在浏览器中打开</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            line-height: 1.6;
        }

        .container {
            background: white;
            border-radius: 20px;
            padding: 40px 30px;
            text-align: center;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            max-width: 400px;
            width: 100%;
            animation: slideIn 0.5s ease-out;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .icon {
            width: 80px;
            height: 80px;
            background: #ff6b6b;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 30px;
            font-size: 40px;
            color: white;
            font-weight: bold;
        }

        h1 {
            color: #333;
            font-size: 24px;
            margin-bottom: 20px;
            font-weight: 600;
        }

        .description {
            color: #666;
            font-size: 16px;
            margin-bottom: 30px;
        }

        .steps {
            text-align: left;
            margin-bottom: 30px;
        }

        .step {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 10px;
            transition: transform 0.2s ease;
        }

        .step:hover {
            transform: translateX(5px);
        }

        .step-number {
            width: 36px;
            height: 36px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            margin-right: 15px;
            flex-shrink: 0;
        }

        .step-text {
            color: #333;
            font-size: 15px;
            flex: 1;
        }

        .menu-icon {
            display: inline-block;
            background: #e9ecef;
            padding: 4px 8px;
            border-radius: 6px;
            font-weight: bold;
            color: #495057;
            font-size: 14px;
            margin: 0 4px;
        }

        .arrow-container {
            position: fixed;
            top: 30px;
            right: 30px;
            text-align: center;
            animation: bounce 2s infinite;
        }

        .arrow {
            font-size: 40px;
            color: #fff;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .arrow-text {
            color: #fff;
            font-size: 14px;
            margin-top: 5px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {
                transform: translateY(0);
            }
            40% {
                transform: translateY(-10px);
            }
            60% {
                transform: translateY(-5px);
            }
        }

        .browser-icons {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 30px;
            opacity: 0.6;
        }

        .browser-icon {
            font-size: 24px;
            color: #666;
        }

        @media (max-width: 480px) {
            .container {
                padding: 30px 20px;
            }
            
            h1 {
                font-size: 20px;
            }
            
            .description {
                font-size: 14px;
            }
            
            .step-text {
                font-size: 14px;
            }
            
            .arrow-container {
                top: 20px;
                right: 20px;
            }
            
            .arrow {
                font-size: 30px;
            }
        }

        .hidden {
            display: none;
        }
    </style>
</head>
<body>
    <!-- 引导页面 -->
    <div id="guidePage">
        <div class="container">
            <div class="icon">!</div>
            <h1>请在浏览器中打开</h1>
            <div class="description">
                检测到您正在微信内置浏览器中访问<br>
                为了获得更好的体验，请按以下步骤操作
            </div>
            
            <div class="steps">
                <div class="step">
                    <div class="step-number">1</div>
                    <div class="step-text">
                        点击右上角 <span class="menu-icon">⋯</span> 菜单
                    </div>
                </div>
                <div class="step">
                    <div class="step-number">2</div>
                    <div class="step-text">
                        选择<span class="menu-icon">在浏览器中打开</span>
                    </div>
                </div>
            </div>
            
            <div class="browser-icons">
                <div class="browser-icon">🌐</div>
                <div class="browser-icon">📱</div>
                <div class="browser-icon">💻</div>
            </div>
        </div>
        
        <div class="arrow-container">
            <div class="arrow">↑</div>
            <div class="arrow-text">点击这里</div>
        </div>
    </div>

    <script>
        // 检测是否为微信浏览器
        function isWeChatBrowser() {
            return /MicroMessenger/i.test(navigator.userAgent);
        }

        // 获取URL参数
        function getUrlParameter(name) {
            const urlParams = new URLSearchParams(window.location.search);
            return urlParams.get(name);
        }

        // 重定向到目标URL
        function redirectToTarget() {
            const targetUrl = getUrlParameter('redirect');
            if (targetUrl) {
               window.location.href = targetUrl;
            }else {
              alert('未指定重定向URL');
            }
        }

        // 页面加载时执行
        window.addEventListener('load', function() {
            if (!isWeChatBrowser()) {
                // 如果不是微信浏览器，直接重定向
              //  setTimeout(redirectToTarget, 500);
            }
            // 如果是微信浏览器，显示引导页面（默认显示）
        });

        // 监听返回按钮（防止用户按返回键）
        window.addEventListener('popstate', function() {
            if (isWeChatBrowser()) {
                history.pushState(null, null, window.location.href);
            }
        });

        // 微信浏览器中阻止默认返回行为
        if (isWeChatBrowser()) {
            history.pushState(null, null, window.location.href);
        }
    </script>
</body>
</html>